FEAT: Added DAOs and Tests for them#2
FEAT: Added DAOs and Tests for them#2mithilesh-08 wants to merge 4 commits intofeat/add-migrations-modelsfrom
Conversation
…ms, redis for trip requests as well
lib/daos/driverLocationDao.js
Outdated
| ...options, | ||
| }, | ||
| ); | ||
| return { driverLocation }; |
There was a problem hiding this comment.
why are we returning driverLocation inside an object?
| return driverLocation; | ||
| }; | ||
|
|
||
| export const findDriversWithinRadius = async ( |
There was a problem hiding this comment.
Where have we added the logic to get only available cabs?
There was a problem hiding this comment.
We havent we will need to add a new col in the driver_location table called is_available
lib/daos/paymentDao.js
Outdated
|
|
||
| export const findPayments = async (where = {}, options = {}) => { | ||
| const payments = await models.payments.findAll({ | ||
| attributes: paymentAttributes, |
There was a problem hiding this comment.
Why do we need to pass a list of attributes in select queries?
| return pricingConfig; | ||
| }; | ||
|
|
||
| export const findAllPricingConfigs = async (page, limit) => { |
There was a problem hiding this comment.
should we also return the total number of items i.e. length? How can the frontend know how many pages there will be?
There was a problem hiding this comment.
I think the redis setup related code should not be inside the dao.
There was a problem hiding this comment.
Fixed this is in the new branch should I do it in this one as well ?
Ticket Link
Related Links
Description
New Models added
their respective tests
Daos Created for
Payments, Trip, Trip Locations, Rating, Driver Locations, Pricing Config, Trip Request (Redis)
Tests for the same have also been added.
Added new mockData, used the mockData in the mocks in the configDb function.
Steps to Reproduce / Test
Checklist
yarn testpassesGIF's